package com.hospital.common.core.hl7Model.setValue;

import com.hospital.common.core.constants.AllFinalValueUtils;
import com.hospital.common.core.hl7Model.fields.*;
import com.hospital.common.core.hl7Model.messages.*;
import com.hospital.common.core.module.entity.OutpDoctorPrescItems;
import com.hospital.common.core.module.entity.OutpDoctorPrescMaster;
import com.hospital.common.core.module.entity.PatientInfo;
import com.hospital.common.core.utils.DateUtil;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.text.SimpleDateFormat;

/**
 * @author lvyao
 * @description 给消息头MSH给值
 * @date 2021/12/27
 */
@Data
public class SetCommSegmentsValue {
    public static MSH getMsh(String send, String recive, String event, String eventName, String hosCode, String hosName, String guid) {
        MSH msh = new MSH();
        msh.setMSH_1("|");
        msh.setMSH_2("^~\\&");
        HD msh_3 = new HD();
        msh_3.setHD_1(send);
        msh_3.setHD_2("");
        msh_3.setHD_3("");
        msh.setMSH_3(msh_3);
        HD msh_4 = new HD();
        msh_4.setHD_1(send);
        msh_4.setHD_2("");
        msh_4.setHD_3("");
        msh.setMSH_4(msh_4);
        HD msh_5 = new HD();
        msh_5.setHD_1(recive);
        msh_5.setHD_2("");
        msh_5.setHD_3("");
        msh.setMSH_5(msh_5);
        HD msh_6 = new HD();
        msh_6.setHD_1(recive);
        msh_6.setHD_2("");
        msh_6.setHD_3("");
        msh.setMSH_6(msh_6);
        msh.setMSH_7(DateUtil.getAllTime());
        msh.setMSH_8("");
        MSG msh_9 = new MSG();
        msh_9.setMSG_1(event);
        msh_9.setMSG_2(eventName);
        msh_9.setMSG_3("");
        msh.setMSH_9(msh_9);
        msh.setMSH_10(guid);
        PT msh_11 = new PT();
        msh_11.setPT_1("P");
        msh_11.setPT_2("");
        msh.setMSH_11(msh_11);
        VID msh_12 = new VID();
        msh_12.setVID_1("2.4");
        msh.setMSH_12(msh_12);
        msh.setMSH_13("");
        msh.setMSH_14("");
        msh.setMSH_15("");
        msh.setMSH_16("");
        msh.setMSH_17("");
        msh.setMSH_18("");
        CE msh_19 = new CE();
        msh_19.setCE_1(hosCode);
        msh.setMSH_19(msh_19);
        msh.setMSH_20(hosName);
        return msh;
    }

    public static PV1 getPV1(String outpId, String outpOrInp,String bedNo,
                             String wordCode,String wordName,String currentDeptCode,
                             String currentDeptName,String doctorCode,String doctorName,
                             String nurseCode,String nurseName,String chargeTypeCode,
                             String consultingDate,String dischargeDisposition,String admissionDateTime,
                             String dischargeDateTime,String totalCosts,String cardId,String notes){
        PV1 pv1 = new PV1();
        pv1.setPV1_1(String.valueOf(outpId));
        pv1.setPV1_2(outpOrInp.equals(AllFinalValueUtils.OUTP_FLAG)?AllFinalValueUtils.OUTP_FLAG_HL7:AllFinalValueUtils.INP_FLAG_HL7);
        PL pv1_3 = new PL();
        pv1_3.setPL_1("");
        pv1_3.setPL_2("");
        pv1_3.setPL_3(bedNo);
        HD pv1_3_4 = new HD();
        pv1_3_4.setHD_1(wordCode);
        pv1_3_4.setHD_2(wordName);
        pv1_3.setPL_4(pv1_3_4);
        pv1_3.setPL_5("");
        pv1_3.setPL_6("");
        pv1_3.setPL_7(currentDeptCode);
        pv1_3.setPL_8(currentDeptName);
        pv1_3.setPL_9("");
        pv1.setPV1_3(pv1_3);
        pv1.setPV1_4("");
        CX pv1_5 = new CX();
        pv1_5.setCX_1(notes);
        pv1.setPV1_5(pv1_5);
        PL pv1_6 = new PL();
        pv1_6.setPL_1("");
        pv1_6.setPL_2("");
        pv1_6.setPL_3("");
        HD pv1_6_4 = new HD();
        pv1_6_4.setHD_1("");
        pv1_6_4.setHD_2("");
        pv1_6.setPL_4(pv1_3_4);
        pv1_6.setPL_5("");
        pv1_6.setPL_6("");
        pv1_6.setPL_7("");
        pv1_6.setPL_8("");
        pv1_6.setPL_9("");
        pv1.setPV1_6(pv1_6);
        XCN pv1_7 = new XCN();
        pv1_7.setXCN_1(doctorCode);
        FN pv1_7_2 =new FN();
        pv1_7_2.setFN_1(doctorName);
        pv1_7.setXCN_2(pv1_7_2);
        pv1_7.setXCN_3("");
        pv1_7.setXCN_4("");
        pv1_7.setXCN_5("");
        pv1.setPV1_7(pv1_7);
        XCN pv1_8 = new XCN();
        pv1_8.setXCN_1(nurseCode);
        FN pv1_8_2 =new FN();
        pv1_8_2.setFN_1(nurseName);
        pv1_8.setXCN_2(pv1_8_2);
        pv1_8.setXCN_3("");
        pv1_8.setXCN_4("");
        pv1_8.setXCN_5("");
        pv1.setPV1_8(pv1_8);
        pv1.setPV1_9(new XCN());
        pv1.setPV1_10("");
        PL pv1_11 = new PL();
        pv1_11.setPL_1("");
        pv1_11.setPL_2("");
        pv1_11.setPL_3("");
        pv1_11.setPL_4(new HD());
        pv1_11.setPL_5("");
        pv1_11.setPL_6("");
        pv1_11.setPL_7("");
        pv1_11.setPL_8("");
        pv1_11.setPL_9("");
        pv1.setPV1_11(pv1_11);
        pv1.setPV1_12("");
        pv1.setPV1_13("");
        pv1.setPV1_14("");
        pv1.setPV1_15("");
        pv1.setPV1_16("");
        XCN pv1_17 = new XCN();
        pv1_17.setXCN_1("");
        pv1_17.setXCN_2(new FN());
        pv1_17.setXCN_3("");
        pv1_17.setXCN_4("");
        pv1_17.setXCN_5("");
        pv1.setPV1_17(pv1_17);
        pv1.setPV1_18(outpOrInp.equals(AllFinalValueUtils.OUTP_FLAG)?AllFinalValueUtils.OUTP_CAUSE:AllFinalValueUtils.INP_CAUSE);
        CX pv1_19 = new CX();
        pv1_19.setCX_1(String.valueOf(outpId));
        pv1.setPV1_19(pv1_19);
        FC pv1_20 = new FC();
        pv1_20.setFC_1(chargeTypeCode);
        pv1.setPV1_20(pv1_20);
        pv1.setPV1_21(new IS());
        pv1.setPV1_22("");
        pv1.setPV1_23("");
        pv1.setPV1_24("");
        pv1.setPV1_25("");
        pv1.setPV1_26("");
        pv1.setPV1_27("");
        pv1.setPV1_28("");
        pv1.setPV1_29("");
        pv1.setPV1_30(consultingDate);
        pv1.setPV1_31("");
        pv1.setPV1_32("");
        pv1.setPV1_33("");
        pv1.setPV1_34("");
        pv1.setPV1_35("");
        pv1.setPV1_36(dischargeDisposition);
        pv1.setPV1_37(new DLD());
        CE pv1_38 = new CE();
        pv1_38.setCE_1("");
        pv1_38.setCE_2("");
        pv1.setPV1_38(pv1_38);
        pv1.setPV1_39("");
        pv1.setPV1_40("");
        pv1.setPV1_41("");
        pv1.setPV1_42(new PL());
        pv1.setPV1_43(new PL());
        pv1.setPV1_44(admissionDateTime);
        pv1.setPV1_45(dischargeDateTime);
        pv1.setPV1_46("");
        pv1.setPV1_47(totalCosts);
        pv1.setPV1_48("");
        pv1.setPV1_49("");
        CX pv1_50= new CX();
        pv1_50.setCX_1(cardId);
        pv1_50.setCX_2("");
        pv1_50.setCX_3("");
        pv1_50.setCX_4(new HD());
        pv1_50.setCX_5("");
        pv1_50.setCX_6(new HD());
        pv1.setPV1_50(pv1_50);
        return pv1;
    }

    public static PID getPid(PatientInfo patientInfo) {
        PID pid = new PID();
        pid.setPID_1("");
        CX pid_2 = new CX();
        pid_2.setCX_1("");
        pid_2.setCX_2("");
        pid.setPID_2(pid_2);
        CX pid_3 = new CX();
        pid_3.setCX_1(patientInfo.getPatientId());
        pid_3.setCX_2("");
        pid.setPID_3(pid_3);
        pid.setPID_4(new CX());
        pid.setPID_4(new CX());
        XPN pid_5 = new XPN();
        FN pid_5_1 = new FN();
        pid_5_1.setFN_1(patientInfo.getName());
        pid_5.setXPN_1(pid_5_1);
        pid_5.setXPN_2("");
        pid_5.setXPN_3("");
        pid_5.setXPN_4("");
        pid_5.setXPN_5("");
        pid.setPID_5(pid_5);
        pid.setPID_6(new XPN());
        pid.setPID_7(new SimpleDateFormat("yyyyMMddHHmmss").format(patientInfo.getDateOfBirth()));
        pid.setPID_8(patientInfo.getSex().equals("女") ? "F" : "M");
        XPN pid_9=new XPN();
        FN pid_9_1 = new FN();
        pid_9_1.setFN_1("");
        pid_9.setXPN_1(pid_9_1);
        pid_9.setXPN_2("");
        pid_9.setXPN_3("");
        pid_9.setXPN_4("");
        pid_9.setXPN_5("");
        pid.setPID_9(pid_9);
        CE pid_10 = new CE();
        pid_10.setCE_1("");
        pid_10.setCE_2("");
        pid_10.setCE_3("");
        pid_10.setCE_4("");
        pid_10.setCE_5("");
        pid_10.setCE_6("");
        pid.setPID_10(pid_10);
        XAD pid_11 = new XAD();
        SAD pid_11_1 = new SAD();
        pid_11_1.setSAD_1(patientInfo.getAddress());
        pid_11.setXAD_1(pid_11_1);
        pid_11.setXAD_2(patientInfo.getDistrict());
        pid_11.setXAD_3(patientInfo.getCity());
        pid_11.setXAD_4(patientInfo.getState());
        pid_11.setXAD_5(patientInfo.getZipCode());
        pid_11.setXAD_6("");
        pid_11.setXAD_7(patientInfo.getMailingAddress());
        pid.setPID_11(pid_11);
        pid.setPID_12("");
        XTN pid_13 = new XTN();
        pid_13.setXTN_1("");
        pid_13.setXTN_2("");
        pid_13.setXTN_3("");
        pid_13.setXTN_4("");
        pid_13.setXTN_5("");
        pid_13.setXTN_6("");
        pid_13.setXTN_7(patientInfo.getPhoneNumberHome());
        pid_13.setXTN_8("");
        pid.setPID_13(pid_13);
        XTN pid_14 = new XTN();
        pid_14.setXTN_1("");
        pid_14.setXTN_2("");
        pid_14.setXTN_3("");
        pid_14.setXTN_4("");
        pid_14.setXTN_5("");
        pid_14.setXTN_6("");
        pid_14.setXTN_7("");
        pid_14.setXTN_8("");
        pid_14.setXTN_8(patientInfo.getPhoneNumberBusiness());
        pid.setPID_14(pid_14);
        CE pid_15  = new  CE();
        pid_15.setCE_1("");
        pid_15.setCE_2("");
        pid_15.setCE_3("");
        pid_15.setCE_4("");
        pid_15.setCE_5("");
        pid_15.setCE_6("");
        pid.setPID_15(pid_15);
        CE pid_16  = new  CE();
        pid_16.setCE_1("");
        pid_16.setCE_2("");
        pid_16.setCE_3("");
        pid_16.setCE_4("");
        pid_16.setCE_5("");
        pid_16.setCE_6("");
        pid.setPID_16(pid_16);
        CE pid_17  = new  CE();
        pid_17.setCE_1("");
        pid_17.setCE_2("");
        pid_17.setCE_3("");
        pid_17.setCE_4("");
        pid_17.setCE_5("");
        pid_17.setCE_6("");
        pid.setPID_17(pid_17);
        CX pid_18 = new CX();
        pid_18.setCX_1("");
        pid_18.setCX_2("");
        pid.setPID_18(pid_18);
        pid.setPID_19(patientInfo.getIdNo());
        DLN pid_20 = new DLN();
        pid_20.setDLN_1("");
        pid_20.setDLN_2("");
        pid.setPID_20(pid_20);
        pid.setPID_21(new CX());
        CE pid_22 = new CE();
        pid_22.setCE_1(patientInfo.getNationCode());
        pid_22.setCE_2(patientInfo.getNation());
        pid_22.setCE_3("");
        pid_22.setCE_4("");
        pid_22.setCE_5("");
        pid_22.setCE_6("");
        pid.setPID_22(pid_22);
        pid.setPID_23(patientInfo.getBitthPlace());
        pid.setPID_24("");
        pid.setPID_25("");
        CE pid_26  = new  CE();
        pid_26.setCE_1("");
        pid_26.setCE_2("");
        pid_26.setCE_3("");
        pid_26.setCE_4("");
        pid_26.setCE_5("");
        pid_26.setCE_6("");
        pid.setPID_26(pid_26);
        CE pid_27  = new  CE();
        pid_27.setCE_1("");
        pid_27.setCE_2("");
        pid_27.setCE_3("");
        pid_27.setCE_4("");
        pid_27.setCE_5("");
        pid_27.setCE_6("");
        pid.setPID_27(pid_27);
        CE pid_28 = new CE();
        pid_28.setCE_1(patientInfo.getCitizenship());
        pid_28.setCE_2(patientInfo.getCountryName());
        pid_28.setCE_3("");
        pid_28.setCE_4("");
        pid_28.setCE_5("");
        pid_28.setCE_6("");
        pid.setPID_28(pid_28);
        pid.setPID_29("");
        pid.setPID_30("");
        pid.setPID_31("");
        pid.setPID_32("");
        pid.setPID_33(new SimpleDateFormat("yyyyMMddHHmmss").format(patientInfo.getCreateDate()));
        HD pid_34 = new HD();
        pid_34.setHD_1("");
        pid_34.setHD_2("");
        pid_34.setHD_3("");
        pid.setPID_34(pid_34);
        pid.setPID_35(new CE());
        CE pid_36 = new CE();
        pid_36.setCE_1("");
        pid_36.setCE_2("");
        pid.setPID_36(pid_36);
        return pid;
    }

    public static DG1 getDG1(String diagNumber,String diagCode,String  diagName,
                             String description,String diagDate,String diagType,
                             String treatResult,String diagDocNo,String diagDocName,
                             String diagDeptCode,String diagDeptName,String notes,
                             String patCondition,String memo,String presentIlness,
                             String pastIlness,String auxExamResult,String symptom){
        DG1 dg1 = new DG1();
        dg1.setDG1_1("");
        dg1.setDG1_2(diagNumber);
        CE dg1_3 = new CE();
        dg1_3.setCE_1(diagCode);
        dg1_3.setCE_2(diagName);
        dg1_3.setCE_3("");
        dg1_3.setCE_4("");
        dg1_3.setCE_5("");
        dg1_3.setCE_6("");
        dg1.setDG1_3(dg1_3);
        dg1.setDG1_4(StringUtils.isBlank(description)?"":description);
//        dg1.setDG1_5(new SimpleDateFormat("yyyyMMddHHmmss").format(outpMedrec.getVisitDate()));
        dg1.setDG1_5(StringUtils.isBlank(diagDate)?"":diagDate);
        dg1.setDG1_6(StringUtils.isBlank(diagType)?"F":diagType);
        CE dg1_7 = new CE();
        dg1_7.setCE_1(StringUtils.isBlank(symptom)?"":symptom);
        dg1_7.setCE_2(StringUtils.isBlank(diagName)?"":diagName);
        dg1_7.setCE_3(StringUtils.isBlank(notes)?"":notes);
        dg1_7.setCE_4(StringUtils.isBlank(patCondition)?"":patCondition);
        dg1_7.setCE_5(StringUtils.isBlank(memo)?"":memo);
        dg1_7.setCE_6(StringUtils.isBlank(presentIlness)?"":presentIlness);
        dg1.setDG1_7(dg1_7);
        CE dg1_8 = new CE();
        dg1_8.setCE_1(StringUtils.isBlank(pastIlness)?"":pastIlness);
        dg1_8.setCE_2(StringUtils.isBlank(auxExamResult)?"":auxExamResult);
        dg1_8.setCE_3("");
        dg1_8.setCE_4("");
        dg1_8.setCE_5("");
        dg1_8.setCE_6("");
        dg1.setDG1_8(dg1_8);
        dg1.setDG1_9("");
        dg1.setDG1_10("");
        CE dg1_11 = new CE();
        dg1_11.setCE_1("");
        dg1_11.setCE_2("");
        dg1_11.setCE_3("");
        dg1_11.setCE_4("");
        dg1_11.setCE_5("");
        dg1_11.setCE_6("");
        dg1.setDG1_11(dg1_11);
        dg1.setDG1_12("");
        dg1.setDG1_13(new CP());
        dg1.setDG1_14(StringUtils.isBlank(treatResult)?"":treatResult);
        dg1.setDG1_15("");
        XCN dg1_16 = new XCN();
        dg1_16.setXCN_1(StringUtils.isBlank(diagDocNo)?"":diagDocNo);
        FN dg1_16_2 = new FN();
        dg1_16_2.setFN_1(StringUtils.isBlank(diagDocName)?"":diagDocName);
        dg1_16_2.setFN_2(StringUtils.isBlank(diagDeptCode)?"":diagDeptCode);
        dg1_16_2.setFN_3(StringUtils.isBlank(diagDeptName)?"":diagDeptName);
        dg1_16.setXCN_2(dg1_16_2);
        dg1_16.setXCN_3("");
        dg1_16.setXCN_4("");
        dg1_16.setXCN_5("");
        dg1_16.setXCN_6("");
        dg1.setDG1_16(dg1_16);
        return dg1;
    }
    public static RXR getRxr(OutpDoctorPrescItems outpDoctorPrescItems, OutpDoctorPrescMaster outpDoctorPrescMaster){
        RXR rxr = new RXR();
        CE ce = new CE();
        ce.setCE_1(outpDoctorPrescItems.getAdministrationCode());
        ce.setCE_2(outpDoctorPrescItems.getAdministration());
        rxr.setRXR_1(ce);
        rxr.setRXR_2(new CE());
        rxr.setRXR_3(new CE());
        rxr.setRXR_4(new CE());
        rxr.setRXR_5(new CE());
        return rxr;
    }
    public static RXO getRxo(OutpDoctorPrescItems outpDoctorPrescItems, OutpDoctorPrescMaster outpDoctorPrescMaster){
        RXO rxo = new RXO();
        CE ce_1 = new CE();
        ce_1.setCE_1(String.valueOf(outpDoctorPrescItems.getVisitNo()));
        ce_1.setCE_2("");
        ce_1.setCE_3(String.valueOf(outpDoctorPrescItems.getItemNo()));
        ce_1.setCE_4(String.valueOf(outpDoctorPrescItems.getItemSubNo()));
        rxo.setRXO_1(ce_1);
        rxo.setRXO_2(String.valueOf(outpDoctorPrescItems.getAmount()));
        rxo.setRXO_3("");
        CE ce_4 = new CE();
        ce_4.setCE_1("");
        ce_4.setCE_2(outpDoctorPrescItems.getUnits());
        rxo.setRXO_4(ce_4);

        CE ce_5 = new CE();
        ce_5.setCE_1(outpDoctorPrescItems.getDrugFormCode());
        ce_5.setCE_2(outpDoctorPrescItems.getDrugForm());
        rxo.setRXO_5(ce_5);

        CE ce_6 = new CE();
        ce_6.setCE_1(outpDoctorPrescItems.getItemClass());
        ce_6.setCE_2(outpDoctorPrescItems.getNotes());
        rxo.setRXO_6(ce_6);

        CE ce_7 = new CE();
        ce_7.setCE_1(DateUtil.formatDate(outpDoctorPrescItems.getVisitDate(),"yyyyMMddHHmmss"));
        rxo.setRXO_7(ce_7);
        LA1 la1_8 =  new LA1();
        rxo.setRXO_8(la1_8);
        rxo.setRXO_9("");
        CE ce_10 = new CE();
        ce_10.setCE_1(outpDoctorPrescItems.getPhamCode());
        ce_10.setCE_2(outpDoctorPrescItems.getPhamName());
        ce_10.setCE_3(outpDoctorPrescItems.getPhamSpec());
        ce_10.setCE_4(outpDoctorPrescItems.getNationalInsuranceCode());
        rxo.setRXO_10(ce_10);
        rxo.setRXO_11(String.valueOf(outpDoctorPrescItems.getAmount()));
        CE ce_12 = new CE();
        ce_12.setCE_1("");
        ce_12.setCE_2(outpDoctorPrescItems.getUnits());
        rxo.setRXO_12(ce_12);
        rxo.setRXO_13(String.valueOf(outpDoctorPrescItems.getDays()));
        XCN xcn_14 = new XCN();
        xcn_14.setXCN_1("");
        xcn_14.setXCN_2(new FN());
        xcn_14.setXCN_3(outpDoctorPrescMaster.getOrderedBy());
        xcn_14.setXCN_4(outpDoctorPrescMaster.getOrderedByName());
        xcn_14.setXCN_5(outpDoctorPrescItems.getPerformedBy());
        xcn_14.setXCN_6(outpDoctorPrescItems.getPerformedByName());
        rxo.setRXO_14(xcn_14);
        rxo.setRXO_15(new XCN());
        rxo.setRXO_16("");
        rxo.setRXO_17(outpDoctorPrescItems.getFrequency());
        rxo.setRXO_18(String.format("%.2f",outpDoctorPrescItems.getPerAmount()));
        CE ce_19 = new CE();
        ce_19.setCE_1("");
        ce_19.setCE_2(outpDoctorPrescItems.getPUnits());
        rxo.setRXO_19(ce_19);
        rxo.setRXO_20(new CE());
        rxo.setRXO_21(String.valueOf(outpDoctorPrescItems.getCosts()));
        rxo.setRXO_22(new CE());
        rxo.setRXO_23(new CQ());
        rxo.setRXO_24(new CE());
        return rxo;
    }
    public static AL1 getAl1(){
        AL1 al1 = new AL1();
        al1.setAL1_1(new CE());
        al1.setAL1_2(new CE());
        al1.setAL1_3(new CE());
        al1.setAL1_4(new CE());
        al1.setAL1_5("");
        al1.setAL1_6("");
        return al1;
    }
    public static EVN getEvn(String eventType,String orderType,String operTime,String operNo,
                             String operName,String operDeptCode,String operDeptName){
        EVN evn = new EVN();
        evn.setEVN_1(eventType);
        evn.setEVN_2(DateUtil.getAllTime());
        evn.setEVN_3("");
        evn.setEVN_4(orderType==null?"":orderType);
        XCN evn_5 = new XCN();
        evn_5.setXCN_1(operTime==null?"":operTime);
        evn_5.setXCN_2(new FN());
        evn_5.setXCN_3("");
        evn_5.setXCN_4("");
        evn_5.setXCN_5("");
        evn_5.setXCN_6("");
        evn_5.setXCN_7("");
        evn_5.setXCN_8("");
        evn_5.setXCN_9(new HD());
        evn_5.setXCN_10("");
        evn_5.setXCN_11("");
        evn_5.setXCN_12("");
        evn_5.setXCN_13("");
        evn_5.setXCN_14(new HD());
        evn_5.setXCN_15("");
        CE evn_5_16 = new CE();
        evn_5_16.setCE_1("");
        evn_5_16.setCE_2(operName==null?"":operName);
        evn_5_16.setCE_3(operNo==null?"":operNo);
        evn_5_16.setCE_4("");
        evn_5_16.setCE_5(operDeptName==null?"":operDeptName);
        evn_5_16.setCE_6(operDeptCode==null?"":operDeptCode);
        evn_5.setXCN_16(evn_5_16);
        evn_5.setXCN_17(new DR());
        evn_5.setXCN_18("");
        evn.setEVN_5(evn_5);
        evn.setEVN_6("");
        evn.setEVN_7(new HD());
        return evn;
    }

    public static NK1 getNk1(PatientInfo patientInfo) {
        NK1 nk1 = new NK1();
        CE nk1_3 =new CE();
        nk1_3.setCE_1(patientInfo.getRelationship());
        nk1_3.setCE_2(patientInfo.getRelationshipName());
        nk1_3.setCE_3("");
        nk1_3.setCE_4("");
        nk1_3.setCE_5("");
        nk1_3.setCE_6("");
        nk1.setNK1_3(nk1_3);
        XTN nk1_5 =new XTN();
        nk1_5.setXTN_1(patientInfo.getPhoneNumberHome());
        nk1_5.setXTN_2("");
        nk1_5.setXTN_3("");
        nk1_5.setXTN_4("");
        nk1_5.setXTN_5("");
        nk1_5.setXTN_6("");
        nk1_5.setXTN_7("");
        nk1_5.setXTN_8("");
        nk1_5.setXTN_9("");
        nk1.setNK1_5(nk1_5);
        return nk1;
    }
}
